<?php

/**
 * HistoriaClinica actions.
 *
 * @package    salud_online
 * @subpackage HistoriaClinica
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 12479 2008-10-31 10:54:40Z fabien $
 */
class HistoriaClinicaActions extends sfActionsCrud 
{
  protected function complementList(sfWebRequest $request, kcDoctrineQuery $q)
  {
  	$usuario_id     = $this->getUser()->getUsuarioId();
  	$this->paciente = Doctrine::getTable('Paciente')->getPacientePrincipal($usuario_id);
  	Doctrine::getTable($this->dbClass)->getQueryForList($q, $this->paciente->getSlug());
  }
  
  protected function complementEdit(sfWebRequest $request)
  {
    $usuario_id = $this->getUser()->getUsuarioId();
  	$paciente   = Doctrine::getTable('Paciente')->getPacientePrincipal($usuario_id);
  	//Deb::print_r($request->getParameterHolder()->getAll());
  	//Deb::print_r($this->obj->toArray());
  	$this->form->getObject()->setPaciente($paciente);
  }
}
